package module.dao;

import common.annotation.DaoSql;
import common.annotation.QueryDao;
import common.bean.SearchParameter;
import module.model.SysRoleModel;

import java.util.List;

@QueryDao
public interface SysRoleDao {
    @DaoSql(sql="SELECT t1.* FROM sys_role t1 LEFT JOIN sys_role_resource t2 ON t1.role_id = t2.role_id WHERE 1=1 { and t2.resource_id=:resourceId }",resultType = "List[SysRoleModelMapping]")
    List<SysRoleModel> getSysRoleModelRoleResourceListBySearchParameter(SearchParameter searchParameter);

    @DaoSql(sql="SELECT t1.* FROM sys_role t1 LEFT JOIN sys_role_dispatcher t2 ON t1.role_id= t2.role_id WHERE 1=1 { and t2.obj_id =:objId } AND t2.obj_type=1 ",resultType = "List[SysRoleModelMapping]")
    List<SysRoleModel> getSysRoleModelRoleDispatcherListBySearchParameter(SearchParameter searchParameter);
}
